package com.gitee.ywj1352.gateway;

import com.gitee.ywj1352.gateway.Iloadbalance.ZookeeperLoadBalancer;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author wenjie.yang on 2019/8/1.
 */
@SpringBootApplication
@EnableDiscoveryClient
@ServletComponentScan(basePackages = "com.gitee.ywj1352.gateway.servlet")
@EnableScheduling
public class GatewayServer {

    public static void main(String[] args) {
        SpringApplication.run(GatewayServer.class,args);
    }


    @Bean
    public ZookeeperLoadBalancer getZookeeperLoadBalancer(DiscoveryClient discoveryClient){
        return new ZookeeperLoadBalancer(discoveryClient);
    }

}
